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