|
|

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