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