|
|

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