|
|

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