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