|
|
楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////
; t- M$ l( o: d1 D" K// Theme Option: n3 y8 W0 H6 Z/ ?
////////////////////////////////////////////////////////////////////////////////$ q. X6 Y2 o: e. i& i2 ~. u! f
5 {0 E: {* A- T Y5 }; E$themename = "Zenx";
7 |8 e" s- m. V3 N9 L3 b$shortname = str_replace(' ', '_', strtolower($themename));2 o: S' a5 J! `# @1 o4 H0 d6 ^
/ P8 D8 y0 ?8 p5 ^1 N4 }
function get_theme_option($option)! Y* B7 m9 ~) ^2 [1 k; a
{$ j0 l- S, b6 h+ W+ V
global $shortname;+ ?- b- T1 L2 c8 [# @6 c$ ~0 U& x- T
return stripslashes(get_option($shortname . '_' . $option));5 ~5 w: E! j+ V Y& `
}
+ M x }: D9 P0 T" P/ n
- T# ]# O5 v. w( J; @$ V2 z3 \7 Ifunction get_theme_settings($option)$ f# O; u8 }; g, v
{& M7 d+ r. n' n
return stripslashes(get_option($option));
# x9 x6 z- Y& {) f}
9 K0 B( S/ V! X1 m* A1 c$wp_dropdown_rd_admin = $wpdb->get_results("SELECT $wpdb->term_taxonomy.term_id,name,description,count FROM $wpdb->term_taxonomy LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id WHERE parent > -1 AND taxonomy = 'category' AND count != '0' GROUP BY $wpdb->terms.name ORDER by $wpdb->terms.name ASC"); ~- s! P8 U- U
$wp_getcat = array();
4 G O5 T. X0 \ y8 L1 A3 Hforeach ($wp_dropdown_rd_admin as $category_list) {! Q& n$ x7 q& u; @1 g
$wp_getcat[$category_list->term_id] = $category_list->name;
3 A4 \3 f1 O0 I+ P1 J K2 D2 e}8 V* q, D# T0 q1 u. `
$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
, @+ _# X6 }; n! C! o2 c$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
2 v: Q# m1 P5 p3 u+ z9 ^$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");
8 [/ @" d( t6 b" Z* s
, Q1 Z* T* z: Q/ J1 T( z- P$options = array (
8 ~) R- m" e) ?& |% T6 M' r' D4 O- N5 O$ P# J5 q
1 e. j" ?3 p: F% M d3 @
array( "name" => "Blog Header Settings",, O d* w/ ^- h' h" W
"type" => "heading",
( M. I' Y+ d0 B7 M" f+ X- s ),2 p7 I; U" S' u' T
7 f6 ~% R: k- [+ S. d( U0 v$ l
array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",: ]* p& q& b+ ?; ~8 b
"id" => $shortname."_header_logo_activate",
4 z3 B; H( Q- b" B. l0 H/ r7 B "type" => "select",4 |1 o- W% ^" F+ G3 W8 \
"std" => "No",/ V: m) S1 g1 t* ]8 b& |( J: S3 {
"options" => array("No", "Yes")),
# H- M3 H7 |+ m' ~& V" E
) O6 w; d, O$ u {) i array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",
4 [4 o$ K$ {, W& x. M0 ~4 R "id" => $shortname."_logo_url",1 P% H+ `2 Q) e* ~; S
"type" => "text",
% S5 X8 Z* P2 I) u8 Y "box" => "social",6 |4 \( W" j) t( Z- i
"std" => "",0 V% r3 J [; a* c1 K1 a
),/ @; Y) {# A4 v7 U4 o4 m- j) d' Y
]/ w. B$ H) P) C1 `$ u
array( "name" => "Insert Header Banner HTML Code (Header)
/ S: r" F6 u5 p' N( C <br /><em>*Recommended Size 468 x 60</em>
: M' [ s: P! L+ a! O' ]) j+ ~ <br /><em>*leave blank if not use</em>",9 L4 b* c! }/ a
"id" => $shortname."_header_banner",
% Q u" J4 [" m. _! [ "type" => "textarea",1 k) B5 v1 }/ _2 Q7 ?; w3 C
"std" => "",
8 A2 }& D: [% l: a6 J ),
9 @7 s( u( s9 c9 L7 ^" ?4 r: |+ t+ p, t6 w; y
array( "name" => "</div></div>",
" U) t6 e: S9 b5 h& l4 J "type" => "close",
8 X2 g, g9 f7 x. ] ),
- U4 p! h2 H: n* T$ n L
3 r: [ G* R. F# g( J/ ~9 }1 o5 |; Y* e7 A7 H1 ]0 }6 a8 |4 V- u( A
array( "name" => "Header Navigation Settings",
1 [7 g( a6 j3 F7 j- p "type" => "heading",
2 n( v" d- m% o# O& p* W, o% j' j ),
* O( L6 K& \% L5 D/ v0 i: i8 g* `3 W$ w7 d2 Y
array( "name" => "Insert Page ID To Exclude On Header Navigation<br />
1 C4 K! o1 m( H6 k# ^0 X% G <em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
5 F" U# s8 H2 |$ `, i1 [7 P9 J/ v <em>*Enter the page post ID number only</em><br />
4 }% \: V: y& S0 Q1 S0 t5 e) @ <em>*separate by comma</em><br />
) G& Y# B+ o& w$ m' k8 d2 t, S: W <em>*Exclude pages which you don't want to show on the header navigation</em>",6 O0 E" c2 R) W- B
"id" => $shortname."_header_page_navigation", ?7 H; T5 G) }/ b" U. P
"type" => "text",+ J: X8 m3 V# i+ s5 a8 Q5 a* h* [
"std" => "",
* x! D* T* ~4 j, q ),- }& z+ h, a. @0 P
N; F: g6 ~( k" Y array( "name" => "</div></div>",( u% U/ z7 v4 |! J x+ B
"type" => "close",* R! k) S; Z: ^+ c# f$ w! u
),
3 M- I& r' z6 d% R% `" { ( S1 n. F3 ]8 W# A6 G
! g- \2 B( j0 B, F) w* | array( "name" => "Post Auto Thumbnails Settings",& T1 w8 b* v8 c3 Y2 V
"type" => "heading",: p7 \8 \9 R' F; G
),1 G- {8 _- L! D
1 a& k0 [ h$ T Q' r5 O
array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
. w' I3 R/ ?* J* G, W. s "id" => $shortname."_timthumb_activate",
* F% e y) g- s5 W: ~, X' { "type" => "select",
# U" V+ Z! b2 s+ }1 | "std" => "No",. e. t& s2 b, q
"options" => array("No", "Yes")),
0 X3 e( q+ ?- r4 n
8 c1 c% o6 b8 c7 A2 E' c array( "name" => "If Timthumb is enabled, Please choose its cropping method",! _3 j6 q' w N, B5 G8 f r
"id" => $shortname."_timthumb_cropping",8 Y L/ X% d# ?' u- m
"type" => "select",
. e7 @) D8 }; G' i3 K7 g( a$ x "std" => "", z# _) P6 \2 p z* c+ r; t
"options" => $crop_position),8 g$ S& Z# L0 z- g' c5 a0 v7 H
$ j* V& a; R8 l3 h' l
array( "name" => "Insert Width Of Thumbnail Image<br />$ u% e+ e2 c; M/ x$ a
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br /> X9 e2 e( z# t3 F3 Z7 @& Y0 D
<em>*Leave Blank To Use Default: 250</em><br />",( f _1 e; C3 D9 t6 e+ W3 S# u
"id" => $shortname."_thumb_width",7 {" L Q+ r7 z! C
"type" => "text",
?+ z$ l+ j' o5 B" w "std" => "",
4 K- {( |/ v: l, W0 i' R" \ ), C( J# K: k! p1 X) C5 ?7 m8 Q( x
) i" e9 h8 L! q" m+ O4 w! D array( "name" => "Insert Height Of Thumbnail Image<br />9 y. M7 V! g" z8 a. J, c o
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
+ a4 I- d; |! @6 ^1 j$ e* h( s1 G <em>*Leave Blank To Use Default: 200</em><br />",
5 w7 r( M3 m. m9 q "id" => $shortname."_thumb_height",
" i5 w) e: M4 i1 p* L "type" => "text",) Z) p; W5 i6 p) n3 z/ p+ M9 ?, q
"std" => "",
0 O" P& u: T1 D ),6 i/ c- }: |; }# q! d3 t
- k% N. v6 S: F4 c! e2 g array( "name" => "</div></div>",* T: L, k! C4 U1 a h# ^9 z
"type" => "close",
: A" Q4 U* a9 v ),6 Y1 H6 }2 j2 u5 m. F
% \4 q! k. o! q0 D( A5 E array( "name" => "Featured Content Slider Settings",
, M$ J) E0 F/ M, m0 F5 b "type" => "heading",1 D1 f/ P5 R6 E
),! x' r- I/ a' ` n% j
) P: U% W$ W0 |( T, \- n) P6 N) l. X- g
array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",' u6 @! m4 P3 ^. H2 g
"id" => $shortname."_featured_activate",
) Z: e4 L/ M( Z' T$ q( R "type" => "select",
4 v$ J% V) m: r' z1 V "std" => "No",
5 q$ M, f2 w2 C& e "options" => array("No", "Yes")),
; W4 `2 \# O. t% c9 z# q' s0 C; s, r: c0 h9 b B# a6 q( r' F
; _" V, j8 u' |- W: Q array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?", z$ S9 Y- ?; e9 f; ]0 C
"id" => $shortname."_featured_category",
1 Z4 R2 b' X9 w% A# b" `* _ "type" => "select",( h" i: _; w1 g$ J) z
"std" => "Choose a category:",& x& A) [8 `. b% e
"options" => $wp_getcat),
! o, C2 n/ n- v$ s: m6 s7 u+ J
7 l# U8 R3 w! g( |+ B* E0 z; H array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",% L4 p6 r" ]# `) }- u
"id" => $shortname."_featured_number",1 B f/ T9 y- X( |- p
"type" => "select",( V7 x. q _ _ [& U2 D
"std" => "Number of post:",6 z& H8 g# L% d' W
"options" => $number_entries),
5 b# P0 J) ^/ L% D6 u8 Q7 Y Y; d0 L( c
array( "name" => "</div></div>",
& U* s$ O9 S) n) c6 g "type" => "close",9 ^/ H* ^0 c6 X+ ~4 r
),
, f, @( B- d7 S9 n" K8 r& p + t" M# }7 ], d8 E
array( "name" => "Featured Category Settings",
) Y3 j. V6 H* c* a. S! c "type" => "heading",3 l/ G7 y [- R) o/ X" ~
),! \8 N+ h: M1 ?% d) u0 a
u* m0 C T8 H) b k. y
array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",% c. z. d i3 ^8 Y U
"id" => $shortname."_featured_category_activate",2 B, [8 a/ o% \1 Q9 [: k z) x. X
"type" => "select",; {7 p! |8 Q9 m$ F
"std" => "No",
. ^- U) L! r7 I A) N: c+ J "options" => array("No", "Yes")),6 g' t$ r* d3 u4 a, ~ Z4 u
3 d7 H3 U2 e" N- H% q6 P array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",2 K% T3 J5 f* {
"id" => $shortname."_featured_category_id1",
7 I! w5 W* ^- I8 i7 i) A& b "type" => "select",
- j8 S5 a [& z9 s6 { "std" => "Choose a category:",- v5 i$ N+ A9 o
"options" => $wp_getcat),, Z. a( _; W" S
6 I, H: p% A; S* W5 `, ^ array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",6 q0 ?6 Y6 Z! p% o7 \" C
"id" => $shortname."_featured_number1",
6 s6 [* c. t8 N; u, W4 j, j "type" => "select",
% K) s. E, ?6 h1 O% f "std" => "Number of post:",
" `7 k: o. X& K' s "options" => $number_entries),
- k) Q$ L- p# ?& K0 n
9 C0 D. [: p' a array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",$ }5 l/ ^( h( ], t" z% T
"id" => $shortname."_featured_category_id2",* L* h3 A* c, A- K
"type" => "select",
: g' h; k# \) o" Y9 k( } "std" => "Choose a category:",
, V/ `: M* @; S" m "options" => $wp_getcat)," X. O8 e' F7 {. J! T" g5 X
- G1 q4 O- Z; L5 M( e
array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
, r0 N4 _; \+ B6 s" f4 v$ d "id" => $shortname."_featured_number2",1 z; ~7 `, D3 S% x: ~ y/ n
"type" => "select",& d2 B" ~: J W7 ^0 Q
"std" => "Number of post:",
1 q) n* {5 c, R6 B& f "options" => $number_entries),
% v5 R0 o4 M" ]* | 7 n: C1 U. c, h$ e7 x
* a ]7 S4 Q( R4 e7 @0 d, U$ o array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",' Q0 }/ O. \* K/ T7 v
"id" => $shortname."_featured_category_id3",
) p* U7 Q% R( d- o "type" => "select",
) l! ?5 W; m; f* m* r4 b "std" => "Choose a category:",
J! t/ [. S! |7 l7 ~7 F# } "options" => $wp_getcat),
) b1 W, u A" C* g8 E: O
- W0 {. u' q8 p2 c' ] array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
0 X& o- z5 m1 Q# J+ r! ?/ j$ m3 k "id" => $shortname."_featured_number3",( G" z" E5 I4 r% `! `1 V/ o
"type" => "select",
# f; c7 }# @/ l3 u' X "std" => "Number of post:",! M8 j/ m3 s% \( _" s" K' q, C
"options" => $number_entries),- }0 e- U9 Q! y3 n! n3 W
% I0 Q2 h. c2 ]! c$ _8 Q* f5 w7 _6 I3 f: l
array( "name" => "</div></div>",) Q/ p. v$ @5 R8 x9 v
"type" => "close",3 W* }1 n3 o# e+ z5 d l' ?
),
+ O: r1 R) X, t) j1 o
0 A, l& Z4 I( H2 a" u
3 e5 K7 K' ~1 O! U array( "name" => "Google Adsense & Analytics Settings",
2 K6 f+ b/ ]5 c, W# S "type" => "heading",
9 @* J$ |) Z* M, B ),
+ E( i$ C* K6 L1 E# v
9 X7 w8 `' {9 }" t" ~ array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",
; y9 M9 f/ R: I7 m$ w0 Z: ^ "id" => $shortname."_adsense_loop_activate",+ W, U5 W: r' ]5 v* X
"type" => "select",
5 d( P/ v9 W# C "std" => "Disable",$ l5 d6 J- W. }/ P# T4 j
"options" => array("Disable", "Enable")),
. E. _, G; @0 [# ~$ `" S2 c( J' x$ x6 t* o% U$ ?
array( "name" => "Insert Google Adsense Code For Loops Here<br />3 j4 B( [( ~6 T6 d9 d
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
' b8 h( N* @# ] "id" => $shortname."_adsense_loop",
9 R$ i k* d, S4 R "type" => "textarea",2 X( X q, W' C5 ~" R
"std" => "",5 A+ O, C- d0 X- c% P- }# A
),: ^, b/ p, q. L9 k9 G
& Q5 F; w1 x- |& E array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",) @- O0 ^1 `2 G5 s( g
"id" => $shortname."_adsense_single_activate",
! O; B# _& T: a( r* J0 d9 N "type" => "select",+ E, b' F+ Z( M, }# L
"std" => "Disable",
, m- J3 X5 d9 q% W0 e( e "options" => array("Disable", "Enable"))," d1 B4 q* X& @( N. Q7 l0 `. t
+ q8 @3 C" `5 q: d c7 K; m
array( "name" => "Insert Google Adsense Code For Single Page Here<br />
; a" W4 k! D2 Z' r) y7 X+ _) M. o <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
R' J/ E$ U- U+ s9 e "id" => $shortname."_adsense_single",+ t+ F& L i1 p' G2 d: L% q8 V
"type" => "textarea",4 S* ~; y, A/ q
"std" => "",: ]" h3 n. w% k. ^5 Z& t' u
),
$ a' ~% y8 e B# e: p/ s
0 H* K L- I9 u2 l7 A( X( z
9 ?+ B# `1 w" _2 |; S- Q p7 u array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
# R4 H- P7 v. X; I "id" => $shortname."_google_analytics",7 G* s& \; u( E3 V
"type" => "textarea",% @( r; q$ j. C
"std" => "",
7 J. n& n( [; b7 _. v% [& ?- y ),
. H0 E+ J3 G2 K* z/ {
& W; }/ |1 p2 l3 a1 ]& c" n array( "name" => "</div></div>"," k! V+ w; ]7 T- K+ Q( {/ c
"type" => "close",0 x, s Z- A B# A) D# d
),7 o- j6 L7 _/ E4 f5 |
: N7 F6 a$ k6 U) P) y
; P7 K8 l4 Z1 s array( "name" => "AddThis Social Bookmarking Settings",
. A/ W2 S; J4 I$ R2 @5 Y$ u7 b "type" => "heading",6 B! \" f& c7 Y8 v* I% p
),2 A% \1 i' h* G% N8 Y; r5 J# e" m7 G9 I
4 k+ G$ D# H8 c" w* ?. m: I0 |/ T
array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
/ v7 d7 ?1 M5 z4 I- ~# i <br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",& m" k5 ^- T) G
"id" => $shortname."_addthis",/ g* \: U5 w" f, ]! _! [
"type" => "text",
; R7 `, W0 v; ?0 G9 m8 f "box" => "social",
2 N4 ^0 f4 Q# K- C- ?% } "std" => "",
a7 K) D: `6 A0 d) h ),
% u5 k% Z' W5 D3 w6 |. q* @& B$ y2 S$ j3 A- B n6 ^8 v( s
array( "name" => "</div></div>",
$ r0 L* Z6 K, f6 R7 h) ` "type" => "close",
& U: K( n- Y. t4 T0 x$ y1 |' A' T# M ),3 H& n2 w( v- \4 j
. [/ M9 \# b& L. A( G2 _
. q1 w0 T+ a" ~ ?4 ~
& n# e$ i2 g# |3 W array( "name" => "YouTube Video Settings",
" a$ \1 R0 D1 B' y. k "type" => "heading",: {% g C8 [6 x# s( b$ t- L- c
),
! J7 Q1 _+ m. j/ K$ H) b
: D+ z4 ~3 c! ?- e1 H/ f9 Q* V array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",3 R) `% Q4 N0 E9 D
"id" => $shortname."_emvideo_activate",
! B6 c1 a% u7 @+ ?" Q "type" => "select",
/ u7 |& V& G; K "std" => "No",
; t3 }! [$ w$ u# t "options" => array("No", "Yes")),
' `+ L4 f* F c, o) o! T2 O( d
& w# h$ {+ `" [3 f m& A5 S' \ array( "name" => "Insert YouTube Video Unique Code<br /><em>*You can find videos to embed on <a href=\"http://www.youtube.com\" target=\"_blank\">YouTube</a> site.</em><br /><em>i.e. Youtube - http://www.youtube.com/watch?v=<span class=\"redbold\">Hr0Wv5DJhuk</span></em><br /><em>*Only Insert The Red Bolded Code Inside Below Setting Box.</em>",
1 K! _2 Y- L/ I& X5 f; U1 o "id" => $shortname."_emvideo",
2 Z# [& w5 r& Z. x0 Q9 Z "std" => "",! R d3 T6 p- S' P
"type" => "text"),
7 X5 E+ J" q3 l! x: Q6 J( H/ H7 O( j* A6 \, a9 c" I. ]' o
array( "name" => "</div></div>",/ F3 \$ }4 R9 @! T, g- H- `/ x/ ^
"type" => "close",6 h6 T% u1 ^1 A2 w8 G! G1 P
),
2 q2 ], J, ] V. r
6 Z8 C1 Z# [. V array( "name" => "Twitter Settings",$ a* p% m8 O' t, }
"type" => "heading",
: o5 `0 ^) t7 p \ ),
- \4 E$ U" I: L W6 s- |1 u8 K6 S" B+ @" c
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",1 M2 W' B% p! n4 t, W( L
"id" => $shortname."_twitter_activate",
* y7 T8 o% h5 e$ C$ j+ [: W "type" => "select",
' C# }5 d$ t+ [+ k% ?, W5 S "std" => "No",
+ \/ b) K+ |8 ^! n* n! o "options" => array("No", "Yes")),: @/ F1 C! A" b+ E3 S6 }' F
! U9 j# a+ U ]6 c% _ array( "name" => "Insert Your Twitter ID here
6 U! r5 Z3 ?, z <br /><em>*leave blank if not necessary</em>: m. s, Z" g) e0 H+ _% M) B
<br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",% x; n& q3 u; j4 t
"id" => $shortname."_twitter",& Y( [. H/ I, G) ]9 E2 O5 O+ m- K& c
"type" => "text",9 \" p2 @# v! D* P+ F; Q
"box" => "social",
' Y- R% m: `+ o9 Y" ~ "std" => "",
4 j9 P0 A+ F0 V J7 i1 c ),& _3 k6 I t# T8 Q
+ H( g, G$ [1 v/ E& p
array( "name" => "Enter Twitter Feed Count here
, j( t* P2 I! Z! [# j3 s <br /><em>*leave blank if not necessary</em>3 _* |9 m% S# Q
<br /><em>*Enter How Many Twitter Feed To Display</em>",
9 w. @. f" |: C' E0 T "id" => $shortname."_twitter_count",/ Z/ B. \' g! x: m
"type" => "text",
4 X+ i7 b4 i! H+ v$ t "box" => "social",
' N5 c3 {3 R/ P2 I1 L "std" => "",! o/ U9 W+ X2 v# M1 l
),
@ v1 H$ B. M, O G" Y8 s$ ?
/ j9 X2 z! i$ {! V array( "name" => "</div></div>",) `1 a( ~! K$ x( A! ~8 o
"type" => "close",
/ N( y! A+ W+ r) Y/ x; Y8 B ),- e2 I9 a6 b. G
$ O8 ~4 N$ q/ i+ P% |" s. {- s! o8 M" G6 }& D" G/ @$ |) p! B
array( "name" => "125 x 125 Banners Advertisement Settings",6 @& S1 R3 e9 z+ B' Y" w& v
"type" => "heading",
! P" R1 H! l9 _: ` ),6 j$ D/ b9 C/ \
! X, P( ^' w+ c6 g7 Z) ~! y; D
array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
: J$ h* y4 v7 B1 p# a: M "id" => $shortname."_sponsor_activate",
9 G6 Z! o2 ~" ^" r "type" => "select",
$ o5 t7 U. e+ z% N5 E" _ "std" => "No",
2 n; Z' B6 [1 d( ~2 I "options" => array("No", "Yes")),7 ` \4 P. L3 u1 n& o
8 g' K# p0 R1 j7 B9 H9 p' n
& p9 |5 r/ b' A j; \ ?7 w array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",' _! J% `7 d E) V' B) r' u; y
"id" => $shortname."_sponsor_banner_one",
5 m- r/ H. S! |8 G "type" => "textarea",. H& d' d% R; z& k% ~9 o
"std" => "",
; O) Y% S2 [$ J0 ? ),
N4 _' e/ h3 F% j6 [' r9 q! ~+ @% Z! q3 d% r, L a* T; \ Q' O$ j
array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",
8 J/ U$ r, f% l "id" => $shortname."_sponsor_banner_two",
! a- t9 Z( S( ^7 S& q "type" => "textarea",
! g1 N1 Q( `8 z* B "std" => "",5 r* M' |# a% q1 l" ?! X$ H
),
, U/ E7 U, g& P8 y1 S
$ v+ g' `7 Y& n w( h array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
" J1 V3 w& M" k: q+ O "id" => $shortname."_sponsor_banner_three",
) [. x& |9 Q& d. O- ` "type" => "textarea",
9 e: K$ I7 c: I "std" => "",( S* `; w# r7 V. v
),' `5 @& X3 p8 ]8 j
: n8 L: P4 N7 m$ n& J7 o* B array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
1 B( I* P, b. ^. s "id" => $shortname."_sponsor_banner_four",
, k+ I. l) h1 }# d! z( Q "type" => "textarea",+ _$ [' P6 u$ i
"std" => "",- z% l+ Q) \7 K9 _1 u
),& | N1 ]5 g6 u) C# D+ l
. B( `+ F: V( L' ]! u' K6 ~+ W
array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",
3 d8 }0 D: Z8 t( }) Z "id" => $shortname."_sponsor_banner_five",
, z) S) y1 C3 G Y9 T6 a9 [- W5 e "type" => "textarea",8 T& |) X* l3 F
"std" => "",
' s0 ~& u$ `* ]" p W/ v; K1 L$ \( ?2 M ),: s! A2 S3 C9 O' `: ]4 F
& \% [& U$ M2 y- b array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",7 i, Q) G0 ]% D* o" W: y
"id" => $shortname."_sponsor_banner_six",
9 `6 z/ B+ I1 f- M- u2 Q7 { "type" => "textarea",
0 x" O( X+ U+ V& i4 `/ y d "std" => "",
- i" Q7 F9 U* f/ f ),
1 ^' Z6 n) j; h" N- J2 Z; a- J% Q0 }& ]
array( "name" => "</div></div>",
# p/ I d- p6 D "type" => "close",
' W2 d" L3 J$ a7 ? ),
( C; H6 e x3 ]
( p5 d' S& x$ c! p0 j5 H- j* A) i) @7 i2 L
6 T$ f2 i6 J1 _6 G
);* k2 g; o! D4 S, X4 B/ Z
O' X+ a' ?- o" U6 j e& T
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {) l! ^: \; A. y& [; `( m2 C
! k2 [# j1 u8 T2 f" t/ y; {$ K4 D
echo "<div id=\"admin-options\"> ";2 ]" Q) V- P6 h9 E
0 S$ c) q% R. m' {% E5 L) E! ]& Z
global $themename, $shortname, $options;: A- b: S% ^& W! x5 h
if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';
& u' E% V1 G% [1 Oif ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';
3 m8 O8 h4 B* I: i/ p?>
& Z) _7 q' u0 b1 w k' ~) Q+ I; o' p9 p5 P2 U; @* E. D/ H
<h4><?php echo "$themename"; ?> Theme Options</h4>$ M( I$ ]: ]' `# K# F
+ P) h# m2 p3 }0 f- d4 s0 W$ F U<div class="annouce">
6 m6 e# x C2 u" B1 z/ f1 Z: u<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>. G. q# D; R& ]' R
<p>Don't Forget to <a href="http://feedburner.google.com/fb/a/mailverify?uri=MagPress&loc=en_US" title="MagPress Newsletter" target="_blank" rel="nofollow"><b>Subscribe Our Free NewsLetter</b></a> In Order To Receive Theme's Updates and Fixes.</p> x2 h4 T1 [0 \ J7 x0 x! X/ V
</div>
, k3 Q. X! f5 _- m# }0 j; ]/ m/ B: K% t) o
<form action="" method="post">$ l7 l/ v0 d- [; |
/ K$ e2 ?8 i: o9 _! n5 L0 o
<?php foreach ($options as $value) { ?>5 m8 z2 l2 ~6 W' h% R
2 V( E7 z! }8 R3 k( a& x0 H0 B
<?php switch ( $value['type'] ) { case 'heading': ?>
4 b- e" @$ u5 V0 `
% S) W D' `; R' D% G5 f<div class="get-option">
# x$ D, P/ G4 s- V% z/ f# F& g% v" J/ y7 E1 D9 o% D
<h2><?php echo $value['name']; ?></h2>8 n; o+ a2 a% |1 o4 f* v: j9 T
* Q/ P+ c; a" G
<div class="option-save">
7 J( V. @/ d; a; q) ^+ l" t& r' b5 b. j' k* R m
<?php% s, T/ t5 Z/ ?1 \
break;/ k* J Y8 ?& U" H
case 'text':
% D; w+ \7 ~8 @- \( n?>
T/ ~4 O' f, ~5 E+ i! @ L" N5 K2 l
<div class="description"><?php echo $value['name']; ?></div># [( W6 {3 Z# ^( C& B, I
<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (! X6 [" t; U, f( F; \1 V5 U8 T5 K
( `5 D% h7 _9 {' J2 @7 Cget_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>
9 t7 R! p# W+ b( O# w6 Q
; H) V* N& e/ a1 S$ M1 \ j<?php
g1 @9 D- d( Jbreak;
- ]3 A/ C- c# p$ _) ]7 k7 jcase 'select':% g- m6 ]9 \4 ?* C) a7 o1 V6 d
?>4 W, F, p/ C3 H% v9 G7 P6 l `7 A9 n
, n4 L9 B. w( u7 y& V4 Z6 R* x4 m) ?<div class="description"><?php echo $value['name']; ?></div>
" d: o- r. _6 {+ C<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">! w# }; W: G. A7 b& u. `
<?php foreach ($value['options'] as $option) { ?>7 B- o' T( s+ A+ |, ?: F
<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
1 J5 g# V0 v" V2 Y6 d, U2 K<?php } ?>! |9 B: h* D) P/ d: }
</select>
& o( K+ e% n6 y' Z- T- n</p>$ J L/ S; L$ P' [7 c% T
2 w5 h' H9 q- `, P+ n
<?php* G# Z+ _$ j+ ?! m N$ z
break;, n# t1 J" @) ?+ A1 d' i6 j
case 'textarea':
9 L- f+ D1 t/ T7 H7 y$valuex = $value['id'];+ G7 ^- z* [. }% v3 _5 P( d
$valuey = stripslashes($valuex);
7 Q. a* L& @. b b! _- A1 w$video_code = get_settings($valuey);# J$ ~6 a+ u% w
?>/ W$ y' l4 E6 A0 t
' T& [( P: R8 X% W* A$ h
<div class="description"><?php echo $value['name']; ?></div>
1 {$ o; [2 h+ b) ^8 q H<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }7 Y' ^% ^9 S% M, k, @
/ s. X2 U9 s# o% @else { echo $value['std']; } ?></textarea></p>
7 f z+ t/ s7 i1 u6 G" v5 x" O. t
# L$ G* g. X) f: }! M<?php" _6 y4 ~, \3 U' Z* o
break;0 [& Q S1 g% N( g' M5 O
case 'close':6 T& ]9 x2 t$ ^; f$ R' X4 O
?>( i$ ^% C" g( E: g% Y) e$ K* ~
$ p+ I* T( X1 y<div class="clearfix"></div>. g- v$ \3 [4 J! J# g/ A6 u
</div><!-- OPTION SAVE END -->! V1 ~( j& b$ D7 t$ |
9 j$ \! S' [( Y! g<div class="clearfix"></div>
# C1 d+ _4 G" a- ~7 ~. j</div><!-- GET OPTION END -->
5 q3 e. x2 F1 A# ~. Q! h# k% n' ?5 P# g# `
<?php
; r+ C% m- y! S( L; }* j* I) }$ sbreak;
8 c8 U3 N9 f' t: x% }default;
1 \! T5 Y0 F2 W8 ^5 l, g?>+ e3 R2 p C5 ]! k9 e% f. x% p
3 R! u( D- Z* ^' n- b
' s! X1 P! k* G3 i8 K
<?php" y# w% R x8 p5 Q1 T
break; } ?>: [8 t$ ]& c1 k% N- ^* _. p# B
. f1 f7 ]) _: N. L
<?php } ?>
2 T! L$ B0 L( t Y. J4 P# H2 g B* p; { _9 H( C
<p class="save-p">! d. G* ?1 S/ F1 r$ r# q2 P
<input name="save" type="submit" class="sbutton" value="Save Options" />
: t9 G) B8 \/ h/ X<input type="hidden" name="action" value="save" />
0 N+ K* e: l( T; Y+ v: c7 S/ t( _</p># w! F' J1 G1 i8 W9 @8 \1 C
</form>5 p& W8 _0 f5 h/ y+ G
5 z3 H$ j( b& f$ N4 @$ p" X2 @
<form method="post">
* C: v$ w8 W( u" y8 E* O( S<p class="save-p">! L8 j0 k, e" J
<input name="reset" type="submit" class="sbutton" value="Reset Options" />3 ]1 j; o' c9 t* K5 B \
<input type="hidden" name="action" value="reset" />
: r6 O# X. V5 i</p>+ A/ J1 J' c( {
</form>
+ q% I! D9 [( v6 c0 W; K" X! w
) _% ~3 O. N/ X( g) A</div><!-- ADMIN OPTIONS END -->4 `0 D7 C" G( O: {# m
* L% Y; \7 ]: A: `; B<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }: n: |% t; m2 z; K: [; Z' L/ s
, O8 Q3 o& P7 T4 a) c* G9 X
function mytheme_admin_register() {% J8 H! w& M" M' A+ L6 V- t
global $themename, $shortname, $options;
9 F, j* s; a: X+ `" k. Wif ( $_GET['page'] == basename(__FILE__) ) {+ Y2 \' Y; |% G
if ( 'save' == $_REQUEST['action'] ) {
! Y0 P- l7 T7 Rforeach ($options as $value) { [) C* l [+ @. K8 w- j9 P0 w% e
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
( I* A( j: p$ G7 Nforeach ($options as $value) {
1 k+ u9 B% P/ W1 J) w9 Gif( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }+ _9 u+ U J8 z0 e
header("Location: themes.php?page=functions.php&saved=true");. N/ _8 X4 W: L0 A3 Z% g
die;
0 D' B3 W; g8 l1 l, _} else if( 'reset' == $_REQUEST['action'] ) {* l9 d% |; y3 J$ g
foreach ($options as $value) {
# D$ B' ~" Q2 y+ h% F/ Ddelete_option( $value['id'] ); }
/ X; k {. d- oheader("Location: themes.php?page=functions.php&reset=true");
0 c5 O7 Y% l' J9 E. gdie;
) b5 ?8 I; |7 j" ?6 h1 Z0 w$ Q4 V}9 h5 g; w2 e! ?# o0 |- l, C
}
( P) N$ Z. P3 Jadd_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
. N2 ]6 M0 I6 W; V}. `# N$ B; ? f( \8 ~
0 r; ^, ^: O9 Z$ N/ `" q
function mytheme_admin_head() { ?>
" k) J' n2 s# B; k% h/ y<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />7 n3 a0 C+ `$ \2 ^9 n5 s+ r3 q
<?php }. y2 Y2 C1 { Z" S9 e H
|
|