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