|
|

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