|
|

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