|
|

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