|
|

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