|
|

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