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